<template>
  <div class="dashboard-card">
    <div class="card-header">
      <h3 class="card-title">
        <i class="icon">📅</i>
        个人待跟进
      </h3>
      <a href="#" class="link">查看全部</a>
    </div>

    <!-- 自定义列表项 -->
    <div class="follow-list">
      <div
        v-for="item in list"
        :key="item.customerName"
        class="follow-item"
        @click="handleDetail(item)"
      >
        <div class="team-info">
          <span class="team-name">{{ item.customerName }}</span>
          <span class="count">订单号:{{ item.orderNo }}</span>
        </div>
        <el-button
          type="primary"
          size="small"
          plain
          class="detail-btn"
          @click.stop="handleDetail(item)"
        >
          跟进
        </el-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
interface FollowItem {
  customerName: string;
  orderNo: string;
}

const list = [
  { customerName: '徐俊聪', orderNo: '5435236742357823' },
  { customerName: '刑聪聪', orderNo: '5435236742357823' },
  { customerName: '陈文波', orderNo: '5435236742357823' }
];

const handleDetail = (item: FollowItem) => {
  console.log('查看', item.customerName, '的详情');
  // 可以跳转或弹窗
};
</script>

<style scoped>
.dashboard-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 18px;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  height: 100%;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon {
  font-size: 18px;
}

.link {
  font-size: 13px;
  color: #409eff;
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

.follow-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.follow-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9fafa;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.follow-item:hover {
  background: #eef5ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.team-info {
  display: flex;
  align-items: center;
}

.team-name {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.count {
  font-size: 12px;
  color: #a0a0a0;
  padding: 4px 8px;
  border-radius: 6px;
}

.detail-btn {
  font-size: 12px;
  padding: 6px 10px;
}
</style>
